package syntax;

//Lembrar que o compilador implementado é baseado no java 1.4, inclusive o aspectJ
//Assim, esse código não contém generics, por exemplo List<Formal> 

import polyglot.ast.*;

import polyglot.ast.*;
import polyglot.ext.jl.ast.Term_c;
import polyglot.types.Flags;
import polyglot.util.Position;
import polyglot.visit.CFGBuilder;
import abc.aspectj.ast.*;
import abc.aspectj.types.AJTypeSystem;
import abc.aspectj.visit.AspectMethods;

import java.util.List;

public syntaxclass MultiIntroOld /*extends Term_c implements IntertypeDecl*/ {

	@grammar extends intertype_member_declaration {
		MultiIntroOld ->
			m = modifiers_opt
			t = type
			id1 = IDENTIFIER
			"+." id2 = IDENTIFIER
			"(" p = formal_parameter_list_opt ")"
			b = block
		{:
			String c = id1.getIdentifier(); 
            String n = id2.getIdentifier();
            MultiIntro x = new MultiIntroOld(parser.pos(m, b), m, t, c, n, p, b);		
			RESULT = x; 
		:}
        |
			m = modifiers_opt
			"void"
			id1 = IDENTIFIER
			"+." id2 = IDENTIFIER
			"(" p = formal_parameter_list_opt ")"
			b = block
			[A B]
        {:
            TypeNode voidn =  parser.nf.CanonicalTypeNode(parser.pos(t),
                                                  parser.ts.Void());
            String c = id1.getIdentifier(); 
            String n = id2.getIdentifier();
            MultiIntro x = new MultiIntroOld(parser.pos(m, b), m, voidn, c, n, p, b);
            RESULT = x;
        :}
		;
	}
	
	private Flags modifiers;
	private TypeNode type;
	private String cl, name;
	private List/*<Formal>*/ param;
	private Block block;

	public MultiIntroOld(Position pos, Flags m, TypeNode t, String c, String n, List l, Block b) {
		//super(pos);
		modifiers = m;
		type = t;
		cl = c;
		name = n;
		param = l;
		block = b;
	}
	

}
